package edu.tyut.game.ui.community

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import androidx.lifecycle.switchMap
import edu.tyut.game.logic.FriendCircleRepository
import okhttp3.MultipartBody

class PostFriendCircleViewModel : ViewModel(){
    // 发送朋友圈
    private val friendCircleLiveData = MutableLiveData<List<MultipartBody.Part>>()
    val resFriendCircle = friendCircleLiveData.switchMap {
        FriendCircleRepository.postFriendCircle(it)
    }
    fun postFriendCircle(parts: List<MultipartBody.Part>){
        friendCircleLiveData.value = parts
    }
}